package com.zhentao.handler;

import com.alibaba.otter.canal.protocol.CanalEntry;
import com.xpand.starter.canal.annotation.CanalEventListener;
import com.xpand.starter.canal.annotation.UpdateListenPoint;
import com.zhentao.files.TbFiles;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

import java.util.List;

/**
 * @ClassName: FilesHandler
 * @Author: 振涛教育_Q
 * @Date: 2024/12/9 10:42
 */
@CanalTable("tb_files")
@Component
@Slf4j
@CanalEventListener
public class FilesHandler implements EntryHandler<TbFiles> {
    /**
     * canal同步添加
     */
    @Override
    public void insert(TbFiles tbFiles) {
        EntryHandler.super.insert(tbFiles);
    }
    /**
     * canal同步修改
     */
    @Override
    public void update(TbFiles before, TbFiles after) {
        log.info("update------------------------------------");
        /*log.info("tb_files开始同步修改准备开始...........");
        FilesDto dto = new FilesDto();
        BeanUtils.copyProperties(after, dto);
        dto.setUid(after.getUId());
        redisHandler.downUpFilesToRedis(dto);
        log.info("tb_files开始同步修改执行完毕...........");*/
        EntryHandler.super.update(before,after);
    }
    /**
     * canal同步删除
     */
    @Override
    public void delete(TbFiles tbFiles) {
        EntryHandler.super.delete(tbFiles);
    }


}
